package com.xingkeduo.dto;

import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * @Description:
 * @Author:gaozifeng
 * @Date 2019/6/4 16:58
 **/
@Data
public class CraftsmanDTO implements Serializable {

    private long id;
    
    private long code;

    private long shopId;

    private String name;

    private String nickName;

    private String path;

    private String phone;

    private int sex_value;

    private String sex_desc;


    public String getName() {
        if(StringUtils.isNotBlank(name)){
            return name;
        }
        return nickName;
    }

    public String getNickName() {
        if(StringUtils.isNotBlank(nickName)){
            return nickName;
        }
        return name;
    }

    /**
     * 如果有昵称显示昵称,否则显示名称
     * @return
     */
    public String getAdminName(){
        if(StringUtils.isNotBlank(nickName)){
            return nickName;
        }
        return name;
    }
}
